/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/3/30 10:54
 * @description:
 */
public class Test21 {

  public static void main(String[] args) {
    int[]a={20,10,45,24,78,53,100,60};
    printlnArry(a);
    px(a);

  }

  private static void px(int[] a) {
    int t;
    for(int i=0;i<a.length-1;i++){
      for(int j=0;j<a.length-i-1;j++){
        if(a[j+1]>a[j]){
          t=a[j];
          a[j]=a[j+1];
          a[j+1]=t;
        }
      }
    }
    printlnArry(a);
  }

  private static void printlnArry(int[] a) {
    for (int i = 0; i < a.length; i++) {
      System.out.print(a[i] + "\t");
    }
    System.out.println();
  }
}
